.overview-page {
  min-height: 100vh;
  background: #f0f9ff;
  padding-bottom: 60px; // 为 tabBar 预留空间

  .overview-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
    color: #fff;
    
    .header-title {
      font-size: 20px;
      font-weight: bold;
    }
  }

  .overview-stats {
    display: flex;
    padding: 20px;
    box-sizing: border-box;
    
    .stat-card {
      flex: 0 0 calc(50% - 7.5px); // 精确计算宽度，减去一半间隙
      background: #fff;
      border-radius: 12px;
      padding: 20px;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
      box-sizing: border-box;
      
      &:first-child {
        margin-right: 15px; // 只给第一个卡片添加右边距
      }
      
      .stat-label {
        font-size: 14px;
        color: #666;
        margin-bottom: 10px;
      }
      
      .stat-value {
        font-size: 24px;
        font-weight: bold;
        word-break: break-all; // 防止长数字溢出
        
        &.expense {
          color: #ff4757;
        }
        
        &.income {
          color: #2ed573;
        }
      }
    }
  }

  .overview-today {
    display: flex;
    padding: 0 20px 20px;
    box-sizing: border-box;
    
    .today-item {
      flex: 0 0 calc(50% - 7.5px); // 精确计算宽度
      background: #fff;
      border-radius: 8px;
      padding: 15px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      box-sizing: border-box;
      
      &:first-child {
        margin-right: 15px; // 只给第一个卡片添加右边距
      }
      
      .today-label {
        font-size: 13px;
        color: #666;
        white-space: nowrap; // 防止文字换行
      }
      
      .today-value {
        font-size: 16px;
        font-weight: bold;
        white-space: nowrap; // 防止数字换行
        
        &.expense {
          color: #ff4757;
        }
        
        &.income {
          color: #2ed573;
        }
      }
    }
  }

  // 本月预算
  .budget-card {
    margin: 0 20px 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 16px;
    box-sizing: border-box;

    .budget-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 12px;

      .budget-title {
        font-size: 15px;
        color: #666;
      }

      .budget-amount {
        font-size: 20px;
        font-weight: 700;
        color: #333;
      }
    }

    .budget-bottom {
      display: flex;
      gap: 12px;

      .budget-item {
        flex: 1;
        background: #f8f9ff;
        border-radius: 10px;
        padding: 12px;
        display: flex;
        align-items: center;
        justify-content: space-between;

        .label { font-size: 14px; color: #666; }
        .value { font-size: 16px; font-weight: 700; }
        .value.income { color: #16a34a; }
        .value.expense { color: #ef4444; }
      }
    }
  }

  .overview-list-title {
    padding: 20px 20px 10px;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    
    .refresh-btn {
      font-size: 14px;
      color: #667eea;
      font-weight: normal;
      padding: 4px 12px;
      border: 1px solid #667eea;
      border-radius: 15px;
      cursor: pointer;
      
      &:active {
        opacity: 0.7;
      }
    }
  }

  .overview-list {
    padding: 0 20px;
    box-sizing: border-box;
    
    .empty-state {
      text-align: center;
      padding: 60px 20px;
      color: #999;
      font-size: 14px;
    }
    
    .list-item {
      background: #fff;
      border-radius: 8px;
      padding: 15px;
      margin-bottom: 10px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      box-sizing: border-box;
      
      .item-left {
        display: flex;
        align-items: center;
        flex: 1;
        min-width: 0; // 防止flex子元素溢出
        margin-right: 10px;
        
        .item-icon {
          width: 40px;
          height: 40px;
          margin-right: 12px;
          flex-shrink: 0; // 防止图标被压缩
        }
        
        .item-info {
          flex: 1;
          min-width: 0; // 防止文字溢出
          
          .item-type {
            font-size: 15px;
            color: #333;
            margin-bottom: 4px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
          }
          
          .item-remarks {
            font-size: 12px;
            color: #999;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
          }
        }
      }
      
      .item-right {
        text-align: right;
        flex-shrink: 0; // 防止右侧内容被压缩
        min-width: 100px; // 确保有足够空间显示金额
        
        .item-amount {
          font-size: 18px;
          font-weight: bold;
          margin-bottom: 4px;
          white-space: nowrap; // 防止换行
          
          &.expense {
            color: #ff4757;
          }
          
          &.income {
            color: #2ed573;
          }
        }
        
        .item-date {
          font-size: 11px;
          color: #999;
          white-space: nowrap; // 防止换行
        }
      }
    }
  }
}

/* 主题：深色模式覆盖 */
.overview-page.theme-dark {
  background: #0f172a;

  .overview-header {
    background: linear-gradient(135deg, #1e2a66 0%, #16204f 100%);
    color: #e5e7eb;
  }

  .overview-stats {
    .stat-card {
      background: #141a2a;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
      .stat-label { color: #9aa4b2; }
      .stat-value { color: #e5e7eb; }
      .stat-value.expense { color: #ff6370; }
      .stat-value.income { color: #39d98a; }
    }
  }

  .overview-today {
    .today-item {
      background: #141a2a;
      .today-label { color: #9aa4b2; }
      .today-value { color: #e5e7eb; }
      .today-value.expense { color: #ff6370; }
      .today-value.income { color: #39d98a; }
    }
  }

  .overview-list-title {
    color: #e5e7eb;
    .refresh-btn {
      color: #8aa2ff;
      border-color: #8aa2ff;
    }
  }

  .overview-list {
    .empty-state { color: #9aa4b2; }
    .list-item {
      background: #141a2a;
      .item-info {
        .item-type { color: #e5e7eb; }
        .item-remarks { color: #9aa4b2; }
      }
      .item-date { color: #9aa4b2; }
    }
  }
}
